Skip to content

[FACT-160] Add circleci open command to next#1229

Merged
pete-woods merged 1 commit intonextfrom
parker/next/open-command
May 6, 2026
Merged

[FACT-160] Add circleci open command to next#1229
pete-woods merged 1 commit intonextfrom
parker/next/open-command

Conversation

@parkuman
Copy link
Copy Markdown

@parkuman parkuman commented Apr 24, 2026

Checklist

=========

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have checked for similar issues and haven't found anything relevant.
  • This is not a security issue (which should be reported here: https://circleci.com/security/)
  • I have read Contribution Guidelines.

Internal Checklist

  • I am requesting a review from my own team as well as the owning team
  • I have a plan in place for the monitoring of the changes that I am making (this can include new monitors, logs to be aware of, etc...)

Changes

=======

  • Add circleci open command in internal/cmd/open/
  • Register open command in internal/cmd/root/root.go
  • Add github.com/pkg/browser dependency for opening URLs in the default browser
  • Add tests for ProjectURL covering GitHub, Bitbucket, GitLab, and invalid slug cases

Rationale

=========

The circleci open command existed on the main branch (cmd/open.go) but was
not carried over during the migration to the next branch. I missed it! This restores the
feature, adapted to the new project structure and conventions (structured errors
via clierrors, git remote detection via internal/gitremote, gotest.tools
for tests).

Considerations

==============

  • Reused the existing internal/gitremote.Detect() package rather than
    reimplementing git remote parsing. This is the same package used by
    circleci project follow.
  • The old implementation only supported GitHub and Bitbucket. This version
    also supports GitLab since gitremote.Detect() already handles it.
  • url.PathEscape is applied to slug segments as a safety net, though in
    practice VCS hosts restrict org/repo names to characters that don't need
    escaping.

Screenshots

============

After

Screen.Recording.2026-04-24.at.11.35.46.AM.mov

@parkuman parkuman marked this pull request as draft April 27, 2026 14:00
@parkuman parkuman changed the title Add 'circleci open' command Add 'circleci open' command to next Apr 27, 2026
@parkuman
Copy link
Copy Markdown
Author

Internal discussions ongoing here: https://circleci.slack.com/archives/C0AUWSGBFQD/p1777045015516229

@parkuman parkuman force-pushed the parker/next/open-command branch from baa85c9 to 3fd4a53 Compare April 27, 2026 18:28
@parkuman parkuman marked this pull request as ready for review April 27, 2026 18:28
@parkuman parkuman changed the title Add 'circleci open' command to next Add circleci open command to next Apr 27, 2026
@parkuman parkuman force-pushed the parker/next/open-command branch from 3fd4a53 to 7553022 Compare April 27, 2026 18:35
@pete-woods pete-woods force-pushed the parker/next/open-command branch from 7553022 to 0754754 Compare May 6, 2026 12:35
The open command was present in the legacy (main) branch but was missed
during the migration to the next branch. This restores the feature,
adapted to the new project structure:

- Detects the project from the git remote (GitHub, Bitbucket, GitLab)
- Opens the CircleCI pipelines page in the default browser
- Uses structured error handling consistent with the new CLI conventions
@pete-woods pete-woods force-pushed the parker/next/open-command branch from 0754754 to c0c6632 Compare May 6, 2026 12:41
@pete-woods pete-woods merged commit a4bb215 into next May 6, 2026
1 check passed
@pete-woods pete-woods deleted the parker/next/open-command branch May 6, 2026 12:50
@pete-woods pete-woods changed the title Add circleci open command to next [FACT-160] Add circleci open command to next May 6, 2026
@linear
Copy link
Copy Markdown

linear Bot commented May 6, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants